﻿using Little.Soldier.SWIFT;
using Little.Soldier.SWIFT.Definition;
using System.ComponentModel;

namespace Little.Soldier.SWIFT.Messages.Category0
{
  public class MT090 : SwiftMessage
  {
    private static SwiftMessageDefinition MessageDefinition;
    private static SwiftTagDefinition U0002;
    private static SwiftTagSubItemDefinition U0003;

    [Description("Free format text for SWIFT-to-user and user-to-SWIFT")]
    public MT090.Tag311 Text_311
    {
      get
      {
        return new MT090.Tag311((SwiftElement) this, 0, (SwiftDefinitionElement) MT090.U0002);
      }
    }

    [Description("Free format text for SWIFT-to-user and user-to-SWIFT")]
    public MT090.Tag311 Tag311_Text
    {
      get
      {
        return this.Text_311;
      }
    }

    public MT090()
      : base(true)
    {
    }

    public MT090(SwiftMessage message)
      : base(message)
    {
    }

    internal override SwiftMessageDefinition MsgDefinition()
    {
      return MT090.MessageDefinition;
    }

    protected override void InitSwiftMessageDefinition()
    {
      MT090.MessageDefinition = new SwiftMessageDefinition("MT090", "User-to-SWIFT Message");
      MT090.U0002 = new SwiftTagDefinition("Text_311", "Free format text for SWIFT-to-user and user-to-SWIFT");
      MT090.U0002.TagName = "{311:";
      MT090.U0003 = new SwiftTagSubItemDefinition("Text", "Text");
      MT090.U0002.Elements.Add((SwiftDefinitionElement) MT090.U0003);
      MT090.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT090.U0002);
    }

    public class Tag311 : SwiftTagWrapper
    {
      public string Value
      {
        get
        {
          return this.GetValue();
        }
        set
        {
          this.SetValue("311", value);
        }
      }

      internal Tag311(SwiftElement parent, int index, SwiftDefinitionElement definition)
        : base(parent, index, definition)
      {
      }
    }
  }
}
